<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>&lt;GOptionGroup&gt;: </title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
<link rel="home" href="index.html" title="">
<link rel="up" href="ch01.html" title="GLib">
<link rel="prev" href="re46.html" title="&lt;%GLibOptionFlags&gt;">
<link rel="next" href="re48.html" title="&lt;GPatternSpec&gt;">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="re46.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="re48.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="id-1.1.48"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>&lt;GOptionGroup&gt;</h2>
<p>&lt;GOptionGroup&gt;</p>
</div>
<div class="refsect1">
<a name="id-1.1.48.2"></a><h2>Description</h2>
<p>A <code class="code">GOptionGroup</code> struct defines the options in a single
group. The struct has only private fields and should not be directly accessed.
</p>
<p>All options in a group share the same translation function. Libraries which
need to parse commandline options are expected to provide a function for
getting a <code class="code">GOptionGroup</code> holding their options, which
the application can then add to its <span class="type">GOptionContext</span>.</p>
</div>
<div class="refsect1">
<a name="id-1.1.48.3"></a><h2>Functions</h2>
<div class="refsect2">
<a name="id-1.1.48.3.2"></a><h3>free</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (option-group:free self))
</pre></div>
<p>Frees a <span class="type">GOptionGroup</span>. Note that you must not free groups
which have been added to a <span class="type">GOptionContext</span>.</p>
<div class="refsect3">
<a name="id-1.1.48.3.2.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>group</p></td>
<td class="parameter_description">
<p>a <span class="type">GOptionGroup</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.48.3.3"></a><h3>ref</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (option-group:ref self))
</pre></div>
<p>Increments the reference count of <em class="parameter"><code>group</code></em> by one.</p>
<div class="refsect3">
<a name="id-1.1.48.3.3.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>group</p></td>
<td class="parameter_description">
<p>a <span class="type">GOptionGroup</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.48.3.4"></a><h3>set-translate-func</h3>
<div class="informalexample"><pre class="programlisting">(define-values
  ()
  (option-group:set-translate-func self func data destroy-notify))
</pre></div>
<p>Sets the function which is used to translate user-visible strings,
for <code class="code">--help</code> output. Different groups can use different
<span class="type">GTranslateFuncs</span>. If <em class="parameter"><code>func</code></em> is <code class="constant">NULL</code>, strings are not translated.
</p>
<p>If you are using <code class="function">gettext()</code>, you only need to set the translation
domain, see <code class="function">g_option_group_set_translation_domain()</code>.</p>
<div class="refsect3">
<a name="id-1.1.48.3.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>group</p></td>
<td class="parameter_description">
<p>a <span class="type">GOptionGroup</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description">
<p>the <span class="type">GTranslateFunc</span>, or <code class="constant">NULL</code></p>
<p>Passed as <code class="code">func</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description">
<p>user data to pass to <em class="parameter"><code>func</code></em>, or <code class="constant">NULL</code></p>
<p>Passed as <code class="code">data</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>destroy_notify</p></td>
<td class="parameter_description">
<p>a function which gets called to free <em class="parameter"><code>data</code></em>, or <code class="constant">NULL</code></p>
<p>Passed as <code class="code">destroy-notify</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.48.3.5"></a><h3>set-translation-domain</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (option-group:set-translation-domain self domain))
</pre></div>
<p>A convenience function to use <code class="function">gettext()</code> for translating
user-visible strings.</p>
<div class="refsect3">
<a name="id-1.1.48.3.5.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>group</p></td>
<td class="parameter_description">
<p>a <span class="type">GOptionGroup</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>domain</p></td>
<td class="parameter_description">
<p>the domain to use</p>
<p>Passed as <code class="code">domain</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.48.3.6"></a><h3>unref</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (option-group:unref self))
</pre></div>
<p>Decrements the reference count of <em class="parameter"><code>group</code></em> by one.
If the reference count drops to 0, the <em class="parameter"><code>group</code></em> will be freed.
and all memory allocated by the <em class="parameter"><code>group</code></em> is released.</p>
<div class="refsect3">
<a name="id-1.1.48.3.6.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>group</p></td>
<td class="parameter_description">
<p>a <span class="type">GOptionGroup</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.48.3.7"></a><h3>option-group:new</h3>
<div class="informalexample"><pre class="programlisting">(define-values
  (%return)
  (option-group:new name description help-description user-data destroy))
</pre></div>
<p>Undocumented</p>
<div class="refsect3">
<a name="id-1.1.48.3.7.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">name</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>description</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">description</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>help_description</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">help-description</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">user-data</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>destroy</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">destroy</code></p>
</td>
</tr>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>
